#include "ThreadPool.hpp"
#include "Task.hpp"
#include <memory>

using namespace ThreadPoolModule;

int main()
{
    ENABLE_CONSOLE_LOG();

    //获取单例
    ThreadPool<task_t>::getInstance()->Start();

    int cnt = 5;

    while(cnt)
    {
        ThreadPool<task_t>::getInstance()->Equeue(Push);
        sleep(1);
        cnt--;
    }
    
    ThreadPool<task_t>::getInstance()->Stop();
    ThreadPool<task_t>::getInstance()->Wait();


    // std::unique_ptr<ThreadPool<task_t>> tp = std::make_unique<ThreadPool<task_t>>();

    // tp->Start();
    // int cnt = 10;
    // while(cnt)
    // {
    //     tp->Equeue(Push);
    //     cnt--;
    //     sleep(1);
    // }

    // tp->Stop();
    // sleep(3);
    // tp->Wait();
    // return 0;
}